package com.gwtplatform.samples.nested.client.attacher;

import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.Widget;

import com.guit.client.View;

public class RootPanelAttacherImpl implements RootPanelAttacher {

    @Override
    public void attach(View view) {
        RootPanel root = RootPanel.get();
        root.clear();
        
        assert view instanceof Widget : "You only can attach widget or composite views";
        
        root.add((Widget) view);
    }
}
